class CollatzCalculator {

    int computeStepCount(int inputNumber) {
        if (inputNumber <= 0){
            throw new IllegalArgumentException("Only natural numbers are allowed");
        }

        int step = 0;
        while (true) {

            if (inputNumber == 1) {
                break;
            }

            if (inputNumber % 2 == 0) {
                inputNumber = inputNumber / 2;
                step++;
                continue;
            }

            if (inputNumber % 2 == 1) {
                inputNumber = inputNumber * 3 + 1;
                step++;
            }
        }

        return step;
    }
}